﻿import express = require('express');
import path = require('path');
import pao = require('./public/pao/public');
import paoServer = require('./public/pao/server/server');
import appConfig = require('./config/appConfig');

let app = express();

// 环境变量
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(app.router);

// 静态目录设定
app.use(express.static(path.join(__dirname, 'public')));

let configFilePath = path.join(__dirname, 'appConfig.json');

// 准备服务应用
let serverApp = <paoServer.serverApplication>paoServer.prepareConfig(appConfig.app, configFilePath, false, true);
// 启动应用
paoServer.startServer(app, serverApp, () => {
    // 启动服务前执行
});
